package router

import (
	"Gin/app/controller"
	"Gin/app/service"
	"github.com/gin-gonic/gin"
)

var RCon *controller.RootController
var UCon *controller.UserController

func CreateRootRouter(e *gin.Engine) {
	e.POST("/login1", RCon.Login)
	e.POST("/getCaptcha")
	e.POST("/login", UCon.Login)
	e.GET("/register", UCon.Register)

	e.GET("/chat", service.GetConn)
	e.GET("/cList", UCon.GetChatList)
	e.GET("/history", UCon.GetHistoryMessage)
	e.GET("/ser", UCon.FindFriend)
	e.POST("/sfm", UCon.SendAddFriend)
	e.GET("/gfm", UCon.GetAddMessage)
	e.GET("/add", UCon.AddFriend)
	e.GET("/unadd", UCon.UnAdd)
	e.GET("/gfl", UCon.GetFriendList)
	e.PUT("/ack", UCon.Acknowledge)
}
